<!DOCTYPE html>
<html>
<head>
    <style>
    body { margin: 0; width:100%%; height:100%%;  background-color:transparent; }
    html { width:100%%; height:100%%; background-color:transparent; }

    .embed-container iframe,
    .embed-container object,
    .embed-container embed {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%% !important;
        height: 100%% !important;
    }
    </style>
</head>
<body>
    <div class="embed-container">
        <iframe id="player" src="https://player.vimeo.com/video/%@?api=1&badge=0&byline=0&portrait=0&title=0&player_id=player" width="100%" height="100%" frameborder="0"></iframe>
    </div>
    <script>
    var Froogaloop=function(){function e(a){return new e.fn.init(a)}function g(a,c,b){if(!b.contentWindow.postMessage)return!1;a=JSON.stringify({method:a,value:c});b.contentWindow.postMessage(a,h)}function l(a){var c,b;try{c=JSON.parse(a.data),b=c.event||c.method}catch(e){}"ready"!=b||k||(k=!0);if(!/^https?:\/\/player.vimeo.com/.test(a.origin))return!1;"*"===h&&(h=a.origin);a=c.value;var m=c.data,f=""===f?null:c.player_id;c=f?d[f][b]:d[b];b=[];if(!c)return!1;void 0!==a&&b.push(a);m&&b.push(m);f&&b.push(f);
        return 0<b.length?c.apply(null,b):c.call()}function n(a,c,b){b?(d[b]||(d[b]={}),d[b][a]=c):d[a]=c}var d={},k=!1,h="*";e.fn=e.prototype={element:null,init:function(a){"string"===typeof a&&(a=document.getElementById(a));this.element=a;return this},api:function(a,c){if(!this.element||!a)return!1;var b=this.element,d=""!==b.id?b.id:null,e=c&&c.constructor&&c.call&&c.apply?null:c,f=c&&c.constructor&&c.call&&c.apply?c:null;f&&n(a,f,d);g(a,e,b);return this},addEvent:function(a,c){if(!this.element)return!1;
            var b=this.element,d=""!==b.id?b.id:null;n(a,c,d);"ready"!=a?g("addEventListener",a,b):"ready"==a&&k&&c.call(null,d);return this},removeEvent:function(a){if(!this.element)return!1;var c=this.element,b=""!==c.id?c.id:null;a:{if(b&&d[b]){if(!d[b][a]){b=!1;break a}d[b][a]=null}else{if(!d[a]){b=!1;break a}d[a]=null}b=!0}"ready"!=a&&b&&g("removeEventListener",a,c)}};e.fn.init.prototype=e.fn;window.addEventListener?window.addEventListener("message",l,!1):window.attachEvent("onmessage",l);return window.Froogaloop=
        window.$f=e}();
    
    var iframe;
    var player;
    
    function injectCmd(cmd) {
        var cmdStr = JSON.stringify({ "event": "inject", "cmd": cmd, "id": 1 });
        iframe.contentWindow.postMessage(cmdStr, "*");
    }
    
    (function(){
        var playbackState = 0;
        var duration = 0.0;
        var position = 0.0;
        var downloadProgress = 0.0;
     
        iframe = document.querySelectorAll('iframe')[0];
        player = $f(iframe);
     
        function updateState() {
            window.location.href = 'vimeoplayer://onState?playback=' + playbackState + '&position=' + position + '&duration=' + duration + '&download=' + downloadProgress;
        }
     
        player.addEvent('ready', function(player_id) {
            window.location.href = 'vimeoplayer://onReady?data=' + player_id;
                        
            player.addEvent('play', onPlay);
            player.addEvent('pause', onPause);
            player.addEvent('finish', onFinish);
            player.addEvent('playProgress', onPlayProgress);
            player.addEvent('loadProgress', onLoadProgress);
                        
            window.setInterval(updateState, 500);
                        
            injectCmd('fixPlayer');
                        
            if (%@) {
                injectCmd('initialPlay');
            }
        });
     
        function onPlay(data) {
            playbackState = 1;
            updateState();
        }

        function onPause(data) {
            playbackState = 0;
            updateState();
        }
     
        function onFinish(data) {
            playbackState = 2;
            updateState();
        }
     
        function onPlayProgress(data) {
            position = data.seconds;
            duration = data.duration;
        }
     
        function onLoadProgress(data) {
            downloadProgress = data.percent;
        }
    })();
    
    </script>
</body>
</html>
